<!DOCTYPE html>
<html>

<head>
<meta charset='UTF-8'>
<title></title>
<link rel='stylesheet' type='text/css' href='../js/easyui-1.3.5/themes/default/easyui.css' />
<link rel='stylesheet' type='text/css' href='../js/easyui-1.3.5/themes/icon.css' />
<script src='../js/easyui-1.3.5/jquery.min.js' type='text/javascript' charset='utf-8'></script>
<script src='../js/easyui-1.3.5/jquery.easyui.min.js' type='text/javascript' charset='utf-8'></script>
<script src='../js/easyui-1.3.5/jquery.edatagrid.js' type='text/javascript' charset='utf-8'></script>
<script src='../js/ajax.js' type='text/javascript' charset='utf-8'></script>
<script type='text/javascript'>
var rootName = ajax.getRootName();
var uri=rootName + '/project/variable'
$(function() {
  $('#dg').edatagrid({
    url:uri+'/list',
    saveUrl:uri+'/save',
    destroyUrl:uri+'/destroy',
    updateUrl:uri+'/update',
    onError: function(index, row) {
      alert(row.msg);
    },
    toolbar:[
      {text:"add",iconCls:"icon-add",handler:function(){
        $('#dg').edatagrid('addRow');
      }},
      {text:'remove',iconCls:"icon-remove",handler:function(){
        $('#dg').edatagrid('destroyRow');
        
      }},
      {text:"save",iconCls:'icon-save',handler:function(){
        $('#dg').edatagrid('saveRow');
      }},
      {text:'undo',iconCls:'icon-undo',handler:function(){
        $('#dg').edatagrid('cancelRow');
      }}
    ],
    columns:[[
      {field:'key',title:'key',editor:{type:'validatebox',options:{required:true}}},
      {field:'value',title:'value',editor:{type:'validatebox',options:{required:true}}},
      {field:'comment',titile:'comment',editor:{type:'validatebox',options:{required:true}}},
      {field:'readOnly',title:'readOnly',editor:{type:'validatabox',optons:{required:true}}}
    ]],
  });
});
</script>
</head>

<body>
<table id='dg' title='配置系统变量', singleSelect='true' rownumbers='true' idField='key'>
</table>
</body>

</html>